using System.Collections;
using System.Collections.Generic;
using QFramework;
using UnityEngine;
using UnityEngine.UI;


//挂在prefab的返回或者关闭按钮上即可,root为prefab的根节点
public class PrefabClose : MonoBehaviour
{
    public GameObject Root;
    void Start()
    {
        //获取按钮组件
        Button btn = GetComponent<Button>();
        //按钮点击监听
        btn.onClick.AddListener(() =>
        {
            Root.DestroySelf();
        });
    }

}
